function [ PatientID, visitDate, visitTime ] = parseFileName( fileName )
%UNTITLED8 Summary of this function goes here
%   Detailed explanation goes here

%Split filename with underscore delimeter
parsedInfo = strsplit(fileName, '_');

%Extract patient ID (trial_id)
PatientID = parsedInfo(1,3);

%Extract visit date in database format
visitDate = char(parsedInfo(1,4));
Y = str2double(visitDate(1:4));
M = str2double(visitDate(5:6));
D = str2double(visitDate(7:8));
visitDate = datestr(datetime(Y,M,D));
visitDate = strrep(visitDate, '-', ' ');


visitTime = char(parsedInfo(1,5));
visitTime = strcat(visitTime(1:2), ':', visitTime(3:4), ...
    ':', visitTime(5:6));

end

